<template>
  <div ref="table">
    {{ msg }}
    <MySon v-if="flag"></MySon>

    <button @click="flag = !flag">销毁子组件</button>
  </div>
</template>

<script>
import MySon from './components/MySon.vue'
export default {
  data() {
    return {
      msg: '123',
      flag: true,
    }
  },
  components: {
    MySon,
  },
}
</script>

<style scoped></style>